{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>十露盘数据服务平台</title>
    <link rel="stylesheet" type="text/css" href="{% static 'login/css/skin_/main.css' %}" />
    <script type="text/javascript" src="{% static 'login/js/jquery.js' %}"></script>
</head>
<body>
    <div id="header">
        <h1>十露盘数据服务平台</h1>
    </div>
    <div id="nav">
        <ul>
            <li>
                <a href="">数据下载</a> <br>
                <ul class="submenu">
                    <li> <a href="{% url 'ddm:post' username %}" class="active"> 编辑任务 </a> </li>
                    <li> <a href="{% url 'ddm:result' username 7 %}">任务进度 </a> </li>
                    <li> <a href="{% url 'login:logout'%}"> 用户注销 </a> </li>
                </ul>
            </li>
        </ul>
    </div>
    <div id="section">
        <h2> 下载任务数据表单</h2>
        <form method="post">
            {% csrf_token %}
            <p>
                <label for="task_name">任务名称：</label>
                <input type="text" name="task_name" placeholder="任务名称"  required >
            </p>
            <p>
                <label for="task_type">任务类型：</label>
                <select name="task_type" id="taskType">
                    <option value="table"> Odps 数据表</option>
                    <option value="report"> Oss 征信报告</option>
                </select>
            </p>
            <p>
                <label for="priority">任务等级：</label>
                <select name="priority">
                        <option value="C">C</option>
                        <option value="A">A</option>
                        <option value="B">B</option>
                        <option value="D">D</option>
                        <option value="E">E</option>
                </select>
            </p>
            <p>
                <label for="project">项目空间：</label>
                <input type="text" name="project" disabled="disabled" placeholder="shilupan_strategy" value="shilupan_strategy" required >
            </p>
            <p>
                <label for="table">数据表名：</label>
                <input type="text" name="table" placeholder="下载的odps表名" required >
            </p>
            <!--<p>-->
                <!--<label for="upload_file">上传文件：</label>-->
                <!--<input type="file"  name="upload_file" placeholder="上传文件" >-->
            <!--</p>-->
            <!--<p>-->
                <!--<label for="save_path">保存路径：</label>-->
                <!--<input type="text"  name="save_path" placeholder="系统默认" >-->
            <!--</p>-->
            <!--</p>-->
            <p class="ossHide">
                <label for="file_type">文件类型：</label>
                <input type="radio" name="file_type" value="csv" checked="checked"> Csv
                <input type="radio" name="file_type" value="txt"> Txt
                <span class="ossShow">
                    <input type="radio" name="file_type" value="xlsx"> Excel
                </span>
            </p>
            <p>
                <label for="delimiter">分割符号：</label>
                <span class="ossShow">
                    <input type="radio" class="ossCheck" name="delimiter" value="" checked="checked"> 默认
                </span>
                <span class="odpsShow">
                    <input type="radio" class="odpsCheck" name="delimiter" value=","> 逗号
                    <input type="radio" name="delimiter" value="|"> 竖线
                    <input type="radio" name="delimiter" value="/"> 反斜杠
                    <input type="radio" name="delimiter" value="Tab"> Tab
                </span>
            </p>
            <p>
                <label for="is_encrypt">加密处理：</label>
                <span class="odpsShow">
                    <!--&lt;!&ndash;&lt;!&ndash; 根据 odps 表  或 oss 报告 的联动效果.&ndash;&gt;&ndash;&gt;-->
                    <input type="radio" name="is_encrypt" class="odpsCheck" value="NO" checked="checked"> 否
                </span>
                <span class="ossShow">
                    <!--&lt;!&ndash;&lt;!&ndash; 根据 odps 表  或 oss 报告 的联动效果.&ndash;&gt;&ndash;&gt;-->
                    <input type="radio" name="is_encrypt" class="ossCheck" value="NO" checked="checked"> 否
                </span>
                    <input type="radio" name="is_encrypt" value="MD5" checked="checked"> MD5
            </p>
            <p>
                <label for="limit">下载条数：</label>
                <input type="number" name="limit" placeholder="默认全部"/>
            </p>
            <p>
                <label for="retain">保存时长：</label>
                <select name="retain">
                        <option value="12">12 Hour</option>
                        <option value="24">24 Hour</option>
                        <option value="48">48 Hour</option>
                        <option value="168">07 Day</option>
                        <option value="360">15 Day</option>
                        <option value="720">30 Day</option>
                </select>
            </p>
            <p>
                <label for="instruction">数据描述：</label>
                <input type="text" name="instruction" placeholder="相关数据内容" required>
            </p>
            <p>
                <label for="purpose">下载用途：</label>
                <input type="text"  name="purpose" placeholder="下载用途说明" required>
            </p>
            <p>
                <label for="remark">额外备注：</label>
                <input type="text" name="remark" placeholder="额外备注">
            </p>
            <p>
               <label for="mail_to">抄送邮箱：</label>
                <input type="checkbox" name="mail_to" value="zhoujin@slooptech.com" checked="checked">周晋
                <!--<input type="checkbox" name="mail_to" value="etl-test@slooptech.com" >ETL组-->
                <input type="checkbox" name="mail_to" value="zhangpeng@slooptech.com">张鹏
                <!--<input type="checkbox" name="mail_to" value="zhoujin@slooptech.com" checked="checked">周晋-->
            </p>
            <input type="submit" value="提交">
        </form>
    </div>
    <div id="footer">
    Copyright slooptech.com
    </div>
<script type="text/javascript">
    $("#nav").height($(window).height()-$("#header").height()-$("#footer").height()-30);
    $(".ossShow").hide();
    $(".odpsShow").show();
    $(".ossCheck").attr("checked", false);
    $(".odpsCheck").attr("checked", true);
    $("#taskType").change(function(){
        if($("#taskType").val() == 'table'){
            $(".ossShow").hide();
            $(".odpsShow").show();
            $(".ossHide").show();
            $(".ossCheck").attr("checked", false);
            $(".odpsCheck").attr("checked", true);
        }else if($("#taskType").val() == 'report'){
            $(".odpsShow").hide();
            $(".ossShow").show();
            $(".ossCheck").attr("checked", true);
            $(".odpsCheck").attr("checked", false);
            $(".ossHide").hide();
        }
    })
</script>
</body>

</html>
